3.104 \(\int \frac{-a+b \cot (c+d x)}{\sqrt{a+b \cot (c+d x)}} \, dx\)

Optimal. Leaf size=102 \[ \frac{(b+i a) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{(-b+i a) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}} \]

[Out]

-(((I*a - b)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a - I*b]])/(Sqrt[a - I*b]*d)) + ((I*a + b)*ArcTanh[Sqrt[a +
 b*Cot[c + d*x]]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)

________________________________________________________________________________________

Rubi [A]  time = 0.161577, antiderivative size = 102, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {3539, 3537, 63, 208} \[ \frac{(b+i a) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{(-b+i a) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}} \]

Antiderivative was successfully verified.

[In]

Int[(-a + b*Cot[c + d*x])/Sqrt[a + b*Cot[c + d*x]],x]

[Out]

-(((I*a - b)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a - I*b]])/(Sqrt[a - I*b]*d)) + ((I*a + b)*ArcTanh[Sqrt[a +
 b*Cot[c + d*x]]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)

Rule 3539

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c
 + I*d)/2, Int[(a + b*Tan[e + f*x])^m*(1 - I*Tan[e + f*x]), x], x] + Dist[(c - I*d)/2, Int[(a + b*Tan[e + f*x]
)^m*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
&& NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rule 3537

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c*
d)/f, Subst[Int[(a + (b*x)/d)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{-a+b \cot (c+d x)}{\sqrt{a+b \cot (c+d x)}} \, dx &=\frac{1}{2} (-a-i b) \int \frac{1+i \cot (c+d x)}{\sqrt{a+b \cot (c+d x)}} \, dx+\frac{1}{2} (-a+i b) \int \frac{1-i \cot (c+d x)}{\sqrt{a+b \cot (c+d x)}} \, dx\\ &=\frac{(i a-b) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \cot (c+d x)\right )}{2 d}-\frac{(i a+b) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \cot (c+d x)\right )}{2 d}\\ &=-\frac{(a-i b) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \cot (c+d x)}\right )}{b d}-\frac{(a+i b) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \cot (c+d x)}\right )}{b d}\\ &=-\frac{(i a-b) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a-i b}}\right )}{\sqrt{a-i b} d}+\frac{(i a+b) \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a+i b}}\right )}{\sqrt{a+i b} d}\\ \end{align*}

Mathematica [A]  time = 0.316147, size = 146, normalized size = 1.43 \[ \frac{b \left (\left (a+\sqrt{-b^2}\right )^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )-\left (a-\sqrt{-b^2}\right )^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a+b \cot (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )\right )}{\sqrt{-b^2} d \sqrt{a-\sqrt{-b^2}} \sqrt{a+\sqrt{-b^2}}} \]

Antiderivative was successfully verified.

[In]

Integrate[(-a + b*Cot[c + d*x])/Sqrt[a + b*Cot[c + d*x]],x]

[Out]

(b*((a + Sqrt[-b^2])^(3/2)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a - Sqrt[-b^2]]] - (a - Sqrt[-b^2])^(3/2)*Arc
Tanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a + Sqrt[-b^2]]]))/(Sqrt[-b^2]*Sqrt[a - Sqrt[-b^2]]*Sqrt[a + Sqrt[-b^2]]*d)

________________________________________________________________________________________

Maple [B]  time = 0.057, size = 1905, normalized size = 18.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-a+b*cot(d*x+c))/(a+b*cot(d*x+c))^(1/2),x)

[Out]

1/4/d/b/(a^2+b^2)*ln(b*cot(d*x+c)+a+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*(2*(
a^2+b^2)^(1/2)+2*a)^(1/2)*a^3+1/4/d*b/(a^2+b^2)*ln(b*cot(d*x+c)+a+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*
a)^(1/2)+(a^2+b^2)^(1/2))*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a-1/4/d/b/(a^2+b^2)^(3/2)*ln(b*cot(d*x+c)+a+(a+b*cot(d
*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^4+1/4/d*b^3/(a^2+b
^2)^(3/2)*ln(b*cot(d*x+c)+a+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*(2*(a^2+b^2)
^(1/2)+2*a)^(1/2)-1/d/b/(a^2+b^2)^(1/2)/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*cot(d*x+c))^(1/2)+(2*(a^2
+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2))*a^3-1/d*b/(a^2+b^2)^(1/2)/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)
*arctan((2*(a+b*cot(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2))*a-1/d*b/(a^2+b
^2)/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2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a)^(1/2))*a-4/d*b/(a^2+b^
2)^(3/2)/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan(((2*(a^2+b^2)^(1/2)+2*a)^(1/2)-2*(a+b*cot(d*x+c))^(1/2))/(2*(a^2
+b^2)^(1/2)-2*a)^(1/2))*a^3

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b \cot \left (d x + c\right ) - a}{\sqrt{b \cot \left (d x + c\right ) + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))/(a+b*cot(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate((b*cot(d*x + c) - a)/sqrt(b*cot(d*x + c) + a), x)

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))/(a+b*cot(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{a}{\sqrt{a + b \cot{\left (c + d x \right )}}}\, dx - \int - \frac{b \cot{\left (c + d x \right )}}{\sqrt{a + b \cot{\left (c + d x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))/(a+b*cot(d*x+c))**(1/2),x)

[Out]

-Integral(a/sqrt(a + b*cot(c + d*x)), x) - Integral(-b*cot(c + d*x)/sqrt(a + b*cot(c + d*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b \cot \left (d x + c\right ) - a}{\sqrt{b \cot \left (d x + c\right ) + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))/(a+b*cot(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate((b*cot(d*x + c) - a)/sqrt(b*cot(d*x + c) + a), x)